package app.fugema.shop.main.home.vm;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;
import app.fugema.shop.main.goods.vm.GoodsVM;
import app.fugema.shop.main.home.model.HomeData;
import app.fugema.shop.main.order.model.ShoppingCartCountBean;

import com.base.common.netBeanPackage.BaseApiResult;
import com.base.common.netBeanPackage.LiveDataWrapper;
import com.base.common.viewmodel.BaseViewModel;

import java.util.HashMap;
import java.util.Map;

import app.fugema.shop.http.HttpService;
import app.fugema.shop.main.order.vm.ShoppingCartVM;

public class MainVM extends BaseViewModel {

    private ShoppingCartVM shoppingCartVM;
    private GoodsVM goodsVM;

    public MainVM(@NonNull Application application) {
        super(application);
        shoppingCartVM = new ShoppingCartVM(application);
        addBaseViewModel(shoppingCartVM);

        goodsVM = new GoodsVM(application);
        addBaseViewModel(goodsVM);
    }

    public GoodsVM getGoodsVM() {
        return goodsVM;
    }

    /**
     *  查询 首页数据
     * @return
     */
    public MutableLiveData<LiveDataWrapper<HomeData>> getHomeData()
    {
        return send(HttpService.getHttpServer().getHomeData());
    }

}
